# -*- coding: UTF-8 -*-
from xml.dom.minidom import parse
import xml.dom.minidom
DOMTree = xml.dom.minidom.parse("movies.xml")
collection = DOMTree.documentElement
# 使用minidom解析器打开xml文档
if collection.hasAttribute('shelf'):
    print("Root element: %s" % (collection.getAttribute('shelf')))

# 在集合中获取所有电影
movies = collection.getElementByTagName('movie')

# 打印每部电影的详细信息
for movie in movies:
    print('******movie******')
    if movie.hasAttribute('title'):
        